package vns.server.domain;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.Rating;
import vns.shared.ObjectTypeRatingDTO;

public class ObjectTypeRating {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key id;
	
	@Persistent
	private Rating value;
	
	public ObjectTypeRating(ObjectTypeRatingDTO objectTypeRatingDTO){
		this.value=objectTypeRatingDTO.getValue();
	}
	
	public void updatefromDTO(ObjectTypeRatingDTO objectTypeRatingDTO){
		this.value=objectTypeRatingDTO.getValue();
	}
	
	public ObjectTypeRatingDTO toDTO(){
		ObjectTypeRatingDTO otRating=new ObjectTypeRatingDTO(this.id,this.value);
		return otRating;
	}
	
	public Key getId(){
		return id;
	}
	
	public Rating getValue(){
		return value;
	}
	
	public void setValue(Rating Value){
		this.value=Value;
	}
}
